<style>
table td {
	vertical-align: top;
	border-bottom: 1px solid #999;
}
</style>

<div data-role="page">
	<div data-role="header" data-theme="b">
	<?php echo empty($curr_news)? CHtml::link("管理员主页",array("/admin"),array("data-icon"=>"info")):CHtml::link("返回上一级",array("news/admin","id"=>$curr_news->parent_id),array("data-icon"=>"back"))?>
		<h1>
		论坛分类管理
		</h1>
	<?php  echo CHtml::link("新建分类",array("news/add","id"=> empty($curr_news)?"0":$curr_news->id),array("data-icon"=>"plus"));?>
	</div>


	<div class="content-primary">
		<?php echo CHtml::form('','post',array('enctype'=>'multipart/form-data',"data-ajax"=>"false")); ?>

		<table style="width: 100%">
			<tr>
				<td width="0"></td>
				<td></td>
				<td>分类名称</td>
				<td>分类说明</td>
				<td>图标</td>
				<td>上传图片</td>
				<td>删除此类</td>
			</tr>			
			<?php foreach($newsies as $news):?>
			<tr>
				<td><?php echo CHtml::activeHiddenField($news,"[{$news->id}]id"); ?>		
					<?php echo CHtml::activeHiddenField($news,"[{$news->id}]parent_id"); ?>
				</td>
				<td><?php  echo CHtml::link("查看",array("news/admin","id"=>$news->id))?>
				</td>
				<td><?php echo CHtml::activeTextField($news,"[{$news->id}]title",array('size'=>10,'maxlength'=>10,"value"=>$news->title)); ?>
				</td>
				<td><?php echo CHtml::activeTextArea($news,"[{$news->id}]description",array('cols'=>20,'rows'=>3,"value"=>$news->description),array("class"=>"wysiwyg")); ?>
				</td>
				<td><?php if(is_file(Yii::app()->basePath."/../images/news/{$news->id}.png")) {
					echo CHtml::image(Yii::app()->request->baseUrl."/images/news/{$news->id}.png","",array("style"=>"width:64px;height:64px"));
				}else{echo CHtml::image(Yii::app()->request->baseUrl."/images/news/nopic.jpg");
				}?>
				</td>
				<td><?php echo CHtml::activeFileField($news,"[{$news->id}]image_file");?>
				</td>
				<td><?php  echo CHtml::link("删除",array("news/delete","id"=>$news->id))?>
				</td>
			</tr>	
			<?php endforeach;?>
		</table>	
		<?php echo CHtml::submitButton('确定'); ?>
		<?php echo CHtml::endForm(); ?>
	</div>
	<!--/content-primary -->

	<?php $this->renderPartial("//site/footer")?>
	<!-- /footer -->
</div>
<!-- /page -->
